//
//  ShowMessage.swift
//  BCProject
//
//  Created by you&me on 2017/11/22.
//  Copyright © 2017年 杨杨威. All rights reserved.
//

import Foundation

class BCShowMessage {
    
    static let shareMessage = BCShowMessage()
    
    func showTipMsg(_ msg: String ,time: Double)  {
        let hud = MBProgressHUD.showAdded(to: UIApplication.shared.keyWindow!, animated: true)
        hud.mode = .text
        hud.label.text = msg
        hud.margin     = 10 // HUD各元素与HUD边缘的间距
        hud.offset.y   = -66 // HUD相对于父视图中心点的x轴偏移量和y轴偏移量
        hud.removeFromSuperViewOnHide = true
        hud.hide(animated: true, afterDelay: time)
        
    }
    
    //显示菊花框
    func showTip(msg : String){
        MBProgressHUD.showAdded(to: UIApplication.shared.keyWindow!, animated: true).label.text = msg
    }
    //隐藏菊花框
    func hidenTip(){
        MBProgressHUD.hide(for: UIApplication.shared.keyWindow!, animated: true)
    }
}
